package com.startup.yellocar.service.impl;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.startup.yellocar.dto.CityDTO;
import com.startup.yellocar.dao.CityDAO;

import com.startup.yellocar.service.CityService;

@Service
@Transactional
public class CityServiceImpl implements CityService {

	@Autowired
	protected CityDAO cityDAO;

	@Transactional
	public void insert(CityDTO cityDTO){
		cityDAO.insert(cityDTO);
	}

	@Transactional
	public void update(CityDTO cityDTO){
		cityDAO.update(cityDTO);
	}

	@Transactional
	public CityDTO get(int id) {
		return cityDAO.get(id);
	}

	@Transactional
	public List<CityDTO> getAll() {
		return cityDAO.getAll();
	}

	@Transactional
	public void delete(CityDTO cityDTO){
		cityDAO.delete(cityDTO);
	}

}
